package com.zzyl.nursing.controller.mumber;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.dto.member.QueryDTO;
import com.zzyl.nursing.service.member.IMemberOrdersProjectService;
import com.zzyl.serve.domain.NursingProject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 服务项Controller
 *
 * @author makangkang
 * @date 2025/10/22 21:35
 */
@RestController
@RequestMapping("/member/orders/project")
public class MemberOrdersProjectController extends BaseController {

    @Autowired
    private IMemberOrdersProjectService memberOrdersProjectService;

    /**
     * 分页查询护理项目列表
     * @param queryDTO
     * @return
     */
    @GetMapping("/page")
    public TableDataInfo getpage(QueryDTO queryDTO) {
        startPage();
        List<NursingProject> nursingProjectList = memberOrdersProjectService.getPage(queryDTO);
        return getDataTable(nursingProjectList);
    }

    /**
     * 根据编号查询护理项目信息
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    public R<NursingProject> getNursingProjectByid(@PathVariable Long id) {
        return R.ok(memberOrdersProjectService.getNursingProjectByid(id));
    }

}
